import { defineStore } from 'pinia'
import Cookie from "js-cookie"
export const useapp = defineStore({
    id: "app",
    state: () => {
        return {
            sidebar: {
                opened: Cookie.get("opened") ? Number(Cookie.get("opened")) : true,
                withoutAnimation: false
            }
        }
    },
    actions: {
        changeOpened() {
            console.log(Number(Cookie.get("opened")));
            this.sidebar.opened = !this.sidebar.opened
            if (this.sidebar.opened) {
                Cookie.set("opened", "1")
            } else {
                Cookie.set("opened", "0")
            }
        }
    },

})